home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / util / SendFaxClient.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  5KB  |  146 lines

  1. /*    $Header: /usr/people/sam/fax/util/RCS/SendFaxClient.h,v 1.10 1994/03/09 18:46:28 sam Rel $ */
  2. /*
  3.  * Copyright (c) 1993, 1994 Sam Leffler
  4.  * Copyright (c) 1993, 1994 Silicon Graphics, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and 
  7.  * its documentation for any purpose is hereby granted without fee, provided
  8.  * that (i) the above copyright notices and this permission notice appear in
  9.  * all copies of the software and related documentation, and (ii) the names of
  10.  * Sam Leffler and Silicon Graphics may not be used in any advertising or
  11.  * publicity relating to the software without the specific, prior written
  12.  * permission of Sam Leffler and Silicon Graphics.
  13.  * 
  14.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  15.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  16.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  17.  * 
  18.  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  19.  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  20.  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21.  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  22.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  23.  * OF THIS SOFTWARE.
  24.  */
  25. #ifndef _SendFaxClient_
  26. #define    _SendFaxClient_
  27.  
  28. #include "FaxClient.h"
  29. #include "StrArray.h"
  30.  
  31. class TypeRule;
  32. class TypeRules;
  33. class DialStringRules;
  34. class PageSizeInfo;
  35. class FileInfo;
  36. class FileInfoArray;
  37.  
  38. typedef unsigned int FaxNotify;
  39.  
  40. class SendFaxClient : public FaxClient {
  41. public:
  42.     enum {
  43.     no_notice,
  44.     when_done,
  45.     when_requeued
  46.     };
  47. private:
  48.     fxStrArray    destNames;        // FAX destination names
  49.     fxStrArray    destNumbers;        // FAX destination dialstrings
  50.     fxStrArray    externalNumbers;    // FAX destination displayable numbers
  51.     fxStrArray    destLocations;        // FAX destination locations
  52.     fxStrArray    destCompanys;        // FAX destination companys
  53.     fxStrArray    coverPages;        // cover pages
  54.     TypeRules*    typeRules;        // file type/conversion database
  55.     DialStringRules* dialRules;        // dial string conversion database
  56.     FileInfoArray* files;        // files to send (possibly converted)
  57.     fxBool    pollCmd;        // do poll rather than send
  58.     fxBool    coverSheet;        // if TRUE, prepend cover sheet
  59.     fxBool    gotPermission;        // got response to checkPermission
  60.     fxBool    permission;        // permission granted/denied
  61.     fxBool    verbose;
  62.     fxStr    killtime;        // job's time to be killed
  63.     fxStr    sendtime;        // job's time to be sent
  64.     float    hres, vres;        // sending resolution (dpi)
  65.     float    pageWidth;        // sending page width (mm)
  66.     float    pageLength;        // sending page length (mm)
  67.     fxStr    pageSize;        // arg to pass to subprocesses
  68.     int        totalPages;        // counted pages (for cover sheet)
  69.     int        maxRetries;        // max number times to try send
  70.     FaxNotify    notify;
  71.     fxBool    setup;            // if true, then ready to send
  72.     fxStrArray    tempFiles;        // stuff to cleanup on abort
  73.  
  74.     fxStr    mailbox;        // user@host return mail address
  75.     fxStr    jobtag;            // user-specified job identifier
  76.     fxStr    comments;        // comments on cover sheet
  77.     fxStr    regarding;        // regarding line on cover sheet
  78.     fxStr    from;            // command line from information
  79.     fxStr    senderName;        // sender's full name
  80.  
  81.     static const fxStr TypeRulesFile;
  82. protected:
  83.     SendFaxClient();
  84.  
  85.     virtual fxStr makeCoverPage(const fxStr& name, const fxStr& number,
  86.     const fxStr& company, const fxStr& location,
  87.     const fxStr& senderName);
  88.  
  89.     virtual void printError(const char* va_alist ...) = 0;
  90.     virtual void printWarning(const char* va_alist ...) = 0;
  91.  
  92.     void countTIFFPages(const char* name);
  93.     void estimatePostScriptPages(const char* name);
  94.     const TypeRule* fileType(const char* filename);
  95.     fxBool handleFile(FileInfo& info);
  96.     fxBool verifyPermission();
  97.     fxBool sendCoverLine(const char* va_alist ...);
  98.  
  99.     virtual void recvConf(const char* cmd, const char* tag);
  100.     virtual void recvEof();
  101.     virtual void recvError(const int err);
  102. public:
  103.     virtual ~SendFaxClient();
  104.  
  105.     virtual fxBool prepareSubmission();
  106.     virtual fxBool submitJob();
  107.  
  108.     fxBool setupSenderIdentity(const fxStr&);
  109.     const fxStr& getSenderName() const;
  110.  
  111.     fxBool addDestination(const char* person, const char* faxnum,
  112.     const char* company, const char* location);
  113.     u_int getNumberOfDestinations() const;
  114.  
  115.     void addFile(const char* filename);
  116.     u_int getNumberOfFiles() const;
  117.  
  118.     fxBool getVerbose() const;
  119.     void setVerbose(fxBool);
  120.     float getPageWidth() const;        // sending page width (mm)
  121.     float getPageLength() const;    // sending page length (mm)
  122.     const fxStr& getPageSize() const;    // arg to pass to subprocesses
  123.     u_int getTotalPages() const;    // counted pages (for cover sheet)
  124.  
  125.     void setCoverComments(const char*);
  126.     const fxStr& getCoverComments() const;
  127.     void setCoverRegarding(const char*);
  128.     const fxStr& getCoverRegarding() const;
  129.     void setCoverSheet(fxBool);
  130.  
  131.     void setResolution(float);
  132.     void setPollRequest(fxBool);
  133.     fxBool getPollRequest() const;
  134.     void setNotification(FaxNotify);
  135.     void setKillTime(const char*);
  136.     void setSendTime(const char*);
  137.     void setFromIdentity(const char*);
  138.     void setJobTag(const char*);
  139.     const fxStr& getFromIdentity() const;
  140.     void setMailbox(const char*);
  141.     const fxStr& getMailbox() const;
  142.     fxBool setPageSize(const char* name);
  143.     void setMaxRetries(int);
  144. };
  145. #endif /* _SendFaxClient_ */
  146.